package cn.tedu.easybuy.service.impl;

import cn.tedu.easybuy.dao.BaseDao;
import cn.tedu.easybuy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
public class BaseServiceImpl<T> implements BaseService<T> {
    @Autowired
    private BaseDao<T> baseDao;

    public void save(T t) {
        baseDao.save(t);
    }

    public void update(T t) {
        baseDao.update(t);
    }

    public void delete(Serializable id) {
        baseDao.delete(id);
    }

    public T get(Serializable id) {
        return baseDao.get(id);
    }

    public List<T> getAll() {
        return baseDao.getAll();
    }
}
